<template>
  <div class="c-bg-sgray">
    <div class="c-flex-row c-ph32 c-pv20 c-bg-white">
      <div class="c-bd1 c-ww180 c-hh180 c-text-hidden">
        <img :src="$addXossFilter(avatar)" class="c-w100" />
      </div>
      <div class="c-flex-column c-justify-sa c-w0 c-pl20 c-hh180 c-flex-grow1 c-hh180 c-fc-gray c-fs20">
        <div>
          <span>承运来源：</span>
          <span class="c-fc-xblack c-wb-ba">{{shipName}}</span>
        </div>
        <div>
          <span>运单编号：</span>
          <span class="c-fc-xblack c-wb-ba">{{shipNo}}</span>
        </div>
      </div>
    </div>

  </div>
</template>

<script>
import { utilJs } from "@/utils/common.js";
let goId = "";
export default {
  name: "MallLogistics",
  components: {},
  props: [],

  data() {
    return {
      avatar: '',
      shipName: "",
      shipNo: "",
      state: {
        0: "货物处于运输过程中",
        1: "货物已由快递公司揽",
        2: "货物寄送过程出了问题",
        3: "收件人已签收",
        4: "退签",
        5: "快递正在进行同城派件",
        6: "退回"
      }
    };
  },
  created() {
    utilJs.appShare(this);
  },
  mounted() { },
  computed: {},
  watch: {},
  methods: {
    getlogistics() {
      utilJs.getMethod(
        global.apiurl + "goodsOrders/logistics?goId=" + goId,
        res => {
          this.shipName = res.shipName;
          this.shipNo = res.shipNo;
          /***
          * state 快递单当前的状态
            0：在途，即货物处于运输过程中；
            1：揽件，货物已由快递公司揽收并且产生了第一条跟踪信息；
            2：疑难，货物寄送过程出了问题；
            3：签收，收件人已签收；
            4：退签，即货物由于用户拒签、超区等原因退回，而且发件人已经签收；
            5：派件，即快递正在进行同城派件；
            6：退回，货物正处于退回发件人的途中；
            该状态还在不断完善中，若您有更多的参数需求，欢迎发邮件至kuaidi@kingdee.com提出。
            status 查询结果状态
            0：物流单暂无结果，
            1：查询成功，
            2：接口出现异常，
          */
        }
      );
    },
    //分享
    wechatShare: function () {
      var shareUrl =
        window.location.href.split("#")[0] +
        "#/?refereeId=" +
        localStorage.getItem("userId");
      utilJs.wechatConfig(shareUrl, "", "", "", function () { });
    },
    //手机端分享
    appShare: function () {
      var shareUrl =
        window.location.href.split("#")[0] +
        "#/?refereeId=" +
        localStorage.getItem("userId");
      utilJs.appShareTrue("", "", shareUrl, "");
    }
  },
  activated() {
    setDocumentTitle("物流信息");// eslint-disable-line
    this.avatar = this.$route.query.avatar;
    goId = this.$route.query.goId;
    this.getlogistics();
    this.wechatShare();
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
</style>
